//this指针
#include <iostream>
using namespace std;
class Solution {
public:
    int x;
    Solution(int x)
    {
        //this指向当前调用成员函数所指向的对象
        this->x=x;
    }
    //this指针作为成员函数的返回值
    Solution& add(Solution &x){
        this->x+=x.x;
        return *this;
    }
};
int main()
{
    Solution s(10);
    Solution x(20);
    cout<<s.x<<endl;
    s.add(x).add(x).add(x);
    cout<<s.x<<endl;
    return 0;
}